#pragma once

#include <cstddef>
#include <memory>
#include <string>

namespace rewine
{

class MapIndicator;

std::shared_ptr<int> auto_fd(int fd);
int open_file_with_readonly(const std::string &filename);

std::shared_ptr<MapIndicator> auto_MapIndicator(const std::shared_ptr<int> &pfd, off_t offset, void *start, size_t len);
int mmap_readonly_file(const std::shared_ptr<int> &pfd, std::shared_ptr<MapIndicator> &map);
int mmap_anonymous(void *start, size_t size, bool bFixed, bool bExec, std::shared_ptr<MapIndicator> &map);

} // namespace rewine
